<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    const getRandom = (min=0,max=100)=>{
        if(typeof min !== 'number' || typeof max !=='number'){
            throw new Error('Argument(s) is illegal !')
        }
        if(min > max){
            [min,max] = [min,max]
        }
        return Math.floor(Math.random()*(max-min+1)+min)
    }
    console.log(getRandom(1,100))
    //getRandom('sdasd',100)
</script>